package com.ourteam.product.model.dao.impl;

import com.ourteam.product.model.dao.IProductModelPropertyRelateDAO;
import com.ourteam.product.model.dao.ProductModelPropertyRelate;
import com.ourteam.product.model.dao.ProductModelPropertyRelateDAOQueryBean;

import net.dao.AbstractSpringDAO;
import net.dao.DataAccessObjectHelper;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/**
 * Template Name : DAO服务对象
 * Template Version : 1
 * Template Last Modfiy Date : Fri Nov 17 11:00:11 IRKT 2017
 * Auto Generate Date : 2017-11-17 11:01:16
  * Warning ! This file will be overwrite when regenerate !
  *
 */
public class AbstractProductModelPropertyRelateDAOJdbcImpl
    extends AbstractSpringDAO implements IProductModelPropertyRelateDAO {
    public static final String[] ENTITY_FIELDS = new String[] {
            Id, RelateCode, RelateName, PropertyId, RelatedPropertyId,
            RelatedType, RelatedConfig, SortIndex, Status, Remarks,
            ObjectRelatedId, RelatedPropertyName, RelatedPropertyDataType,
            RelatedPropertyDataTypeId, RelatedPropertyDataLength,
            RelatedPropertyDataAccuracy, RelatedPropertyIsAllowNull,
            RelatedPropertyisPrimaryKey, RelatedPropertyIsAutoInc,
            RelatedPropertyObjectId, RelatedPropertyObjectName,
            RelatedPropertyObjectType, PropertyName, PropertyObjectId,
            PropertyDataType, PropertyObjectName, PropertyObjectType
        };
    public static final String[] ENTITY_PROPERTIES = new String[] {
            _DataObjectProperty.Id, _DataObjectProperty.RelateCode,
            _DataObjectProperty.RelateName, _DataObjectProperty.PropertyId,
            _DataObjectProperty.RelatedPropertyId,
            _DataObjectProperty.RelatedType, _DataObjectProperty.RelatedConfig,
            _DataObjectProperty.SortIndex, _DataObjectProperty.Status,
            _DataObjectProperty.Remarks, _DataObjectProperty.ObjectRelatedId,
            _DataObjectProperty.RelatedPropertyName,
            _DataObjectProperty.RelatedPropertyDataType,
            _DataObjectProperty.RelatedPropertyDataTypeId,
            _DataObjectProperty.RelatedPropertyDataLength,
            _DataObjectProperty.RelatedPropertyDataAccuracy,
            _DataObjectProperty.RelatedPropertyIsAllowNull,
            _DataObjectProperty.RelatedPropertyisPrimaryKey,
            _DataObjectProperty.RelatedPropertyIsAutoInc,
            _DataObjectProperty.RelatedPropertyObjectId,
            _DataObjectProperty.RelatedPropertyObjectName,
            _DataObjectProperty.RelatedPropertyObjectType,
            _DataObjectProperty.PropertyName,
            _DataObjectProperty.PropertyObjectId,
            _DataObjectProperty.PropertyDataType,
            _DataObjectProperty.PropertyObjectName,
            _DataObjectProperty.PropertyObjectType
        };
    public static final String[] ENTITY_PK_FIELDS = new String[] { Id };
    public static final String[] ENTITY_AUTO_GEN_PK_FIELDS = new String[] { Id };
    public static final String[] ENTITY_UNIQUE_FIELDS = new String[] {  };
    private static String relatedJoinSQL = null;
    private static String basicFilterSQL = null;
    private DataAccessObjectHelper<ProductModelPropertyRelate, ProductModelPropertyRelateDAOQueryBean> daoHelper;

    public AbstractProductModelPropertyRelateDAOJdbcImpl() {
        super();
        daoHelper = new DataAccessObjectHelper<ProductModelPropertyRelate, ProductModelPropertyRelateDAOQueryBean>(this);
    }

    protected String getEntityName() {
        return EntityName;
    }

    protected String[] getEntityFields() {
        return ENTITY_FIELDS;
    }

    protected String[] getEntityProperties() {
        return ENTITY_PROPERTIES;
    }

    protected String[] getEntityPKFields() {
        return ENTITY_PK_FIELDS;
    }

    protected String[] getEntityAutoGenPKFields() {
        return ENTITY_AUTO_GEN_PK_FIELDS;
    }

    protected String[] getEntityUniqueFields() {
        return ENTITY_UNIQUE_FIELDS;
    }

    protected String getBaiscQueryFilter() {
        if (basicFilterSQL == null) {
            StringBuffer basicFilterSQLbuffer = new StringBuffer();

            basicFilterSQL = basicFilterSQLbuffer.toString();
        }

        return basicFilterSQL;
    }

    protected String getRelatedJoinSQL() {
        if (relatedJoinSQL == null) {
            StringBuffer relatedJoinSQLBuffer = new StringBuffer();

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.product.model.dao.IProductModelPropertyDAO.EntityName)
                                .append(" PRODUCT_MODEL_PROPERTY ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.product.model.dao.IProductModelPropertyDAO.Id,
                    com.ourteam.product.model.dao.IProductModelPropertyDAO.EntityName +
                    ".", "PRODUCT_MODEL_PROPERTY."));
            relatedJoinSQLBuffer.append(" = ").append(RelatedPropertyId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.product.model.dao.IProductModelObjectDAO.EntityName)
                                .append(" PRODUCT_MODEL_OBJECT ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.product.model.dao.IProductModelObjectDAO.Id,
                    com.ourteam.product.model.dao.IProductModelObjectDAO.EntityName +
                    ".", "PRODUCT_MODEL_OBJECT."));
            relatedJoinSQLBuffer.append(" = ").append(RelatedPropertyObjectId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.product.model.dao.IProductModelPropertyDAO.EntityName)
                                .append(" MAIN_PRODUCT_MODEL_PROPERTY ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.product.model.dao.IProductModelPropertyDAO.Id,
                    com.ourteam.product.model.dao.IProductModelPropertyDAO.EntityName +
                    ".", "MAIN_PRODUCT_MODEL_PROPERTY."));
            relatedJoinSQLBuffer.append(" = ").append(PropertyId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.product.model.dao.IProductModelObjectDAO.EntityName)
                                .append(" MAIN_PROPERTY_OBJECT ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.product.model.dao.IProductModelObjectDAO.Id,
                    com.ourteam.product.model.dao.IProductModelObjectDAO.EntityName +
                    ".", "MAIN_PROPERTY_OBJECT."));
            relatedJoinSQLBuffer.append(" = ").append(PropertyObjectId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQL = relatedJoinSQLBuffer.toString();
        }

        return relatedJoinSQL;
    }

    /**
         * Check Data Unique
         * @param aProductModelPropertyRelate
         * @throws Exception
         */
    public boolean checkIsUnique(
        ProductModelPropertyRelate aProductModelPropertyRelate)
        throws Exception {
        if (aProductModelPropertyRelate == null) {
            return true;
        }

        List valueList = new ArrayList();

        List pkValueList = new ArrayList();

        pkValueList.add(aProductModelPropertyRelate.getId());

        return isUnique(valueList.toArray(new Object[valueList.size()]),
            pkValueList.toArray(new Object[pkValueList.size()]));
    }

    /**
     * Insert Data
     * @param aProductModelPropertyRelate
     * @throws Exception
     */
    public void insert(ProductModelPropertyRelate aProductModelPropertyRelate)
        throws Exception {
        super.doInsert(aProductModelPropertyRelate);
    }

    /**
         * Batch Insert Datas
         * @param aProductModelPropertyRelate
         * @throws Exception
         */
    public void batchInsert(
        ProductModelPropertyRelate[] aProductModelPropertyRelates)
        throws Exception {
        super.doBatchInsert(aProductModelPropertyRelates);
    }

    /**
         * Delete Data
         * @param  final long id         *
         * @throws Exception
         */
    public void delete(final long id) throws Exception {
        super.doDeleteById(new Object[] { new Long(id) });
    }

    /**
     * Delete Datas
     * @param queryBean
     * @throws Exception
     */
    public void delete(ProductModelPropertyRelateDAOQueryBean queryBean)
        throws Exception {
        super.doDeleteByQuery(queryBean);
    }

    public void delete(ProductModelPropertyRelate aProductModelPropertyRelate)
        throws Exception {
        delete(aProductModelPropertyRelate.getId());
    }

    /**
     * Update Data Selective
     * @param aProductModelPropertyRelate
     * @throws Exception
     */
    public void update(ProductModelPropertyRelate aProductModelPropertyRelate)
        throws Exception {
        if (aProductModelPropertyRelate.getId() == 0) {
            throw new Exception(
                "Can not update object data whith out primary key value");
        }

        super.doUpdate(aProductModelPropertyRelate);

        ProductModelPropertyRelate tempObj = findById(aProductModelPropertyRelate.getId());

        if (tempObj != null) {
            PropertyUtils.copyProperties(aProductModelPropertyRelate, tempObj);
        }
    }

    /**
     * Batch Update Datas
     * @param aProductModelPropertyRelates[]
     * @throws Exception
     */
    public void batchUpdate(
        ProductModelPropertyRelate[] aProductModelPropertyRelates)
        throws Exception {
        super.doBatchUpdate(aProductModelPropertyRelates);
    }

    /**
         * Update Data By Condictions
         * @param aProductModelPropertyRelate
         * @param aValueCriteria
         * @param aTransaction
         * @throws Exception
         */
    public void update(ProductModelPropertyRelate aProductModelPropertyRelate,
        ProductModelPropertyRelateDAOQueryBean aQueryBean)
        throws Exception {
        super.doUpdateByQuery(aProductModelPropertyRelate, aQueryBean);
    }

    /**
     * Update Data By Condictions
     * @param aQueryBean
     * @throws Exception
     */
    public void update(ProductModelPropertyRelateDAOQueryBean aQueryBean)
        throws Exception {
        super.doUpdateByQuery(aQueryBean);
    }

    protected void checkNullValue(
        ProductModelPropertyRelate aProductModelPropertyRelate)
        throws Exception {
        if (aProductModelPropertyRelate.getRelateCode() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relateCode value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelateName() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relateName value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedType() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedType value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedConfig() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedConfig value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getStatus() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.status value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRemarks() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.remarks value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedPropertyName() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedPropertyName value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedPropertyDataType() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedPropertyDataType value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedPropertyIsAllowNull() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedPropertyIsAllowNull value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedPropertyisPrimaryKey() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedPropertyisPrimaryKey value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedPropertyIsAutoInc() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedPropertyIsAutoInc value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedPropertyObjectName() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedPropertyObjectName value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getRelatedPropertyObjectType() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.relatedPropertyObjectType value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getPropertyName() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.propertyName value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getPropertyObjectName() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.propertyObjectName value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getPropertyObjectType() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.propertyObjectType value is not allow NULL");
        }

        if (aProductModelPropertyRelate.getPropertyDataType() == null) {
            throw new Exception(
                "The ProductModelPropertyRelate.propertyDataType value is not allow NULL");
        }
    }

    /**
     * Get Data By ID
     * @param  final long id         * @return  ${businessObject.name}
     * @throws Exception
     */
    public ProductModelPropertyRelate findById(final long id)
        throws Exception {
        ProductModelPropertyRelateDAOQueryBean queryBean = new ProductModelPropertyRelateDAOQueryBean();

        ProductModelPropertyRelateDAOQueryBean.Criteria criteria = queryBean.createCriteria();

        criteria.andIdEqualTo(id);

        //queryBean.setDistinct(true);
        ProductModelPropertyRelate[] ProductModelPropertyRelates = query(queryBean);

        if (ProductModelPropertyRelates.length == 0) {
            return null;
        } else {
            return ProductModelPropertyRelates[0];
        }
    }

    /**
         * Query Data
         * @param queryBean
         * @return ProductModelPropertyRelate[]
         * @throws Exception
         */
    public ProductModelPropertyRelate[] query(
        ProductModelPropertyRelateDAOQueryBean queryBean)
        throws Exception {
        List result = super.doQuery(queryBean,
                new JdbcProductModelPropertyRelateRowMapper());

        return (ProductModelPropertyRelate[]) result.toArray(new ProductModelPropertyRelate[result.size()]);
    }

    /**
     * Query ${businessObject.name} Selective
     * @param queryBean
     * @return Map[]
     * @model
     * @throws Exception
     */
    public Map<String, Object>[] querySelective(
        ProductModelPropertyRelateDAOQueryBean queryBean)
        throws Exception {
        if (queryBean.getSelectProperties().isEmpty()) {
            queryBean.addAllSelectProperties();
        }

        return super.doQuerySelective(queryBean);
    }

    /**
     * Query Data Count
     * @param queryBean
     * @return int
     * @throws Exception
     */
    public int queryCount(ProductModelPropertyRelateDAOQueryBean queryBean)
        throws Exception {
        return super.doQueryCount(queryBean);
    }

    public void synchronize(
        ProductModelPropertyRelate[] aProductModelPropertyRelates,
        ProductModelPropertyRelateDAOQueryBean queryBean)
        throws Exception {
        daoHelper.synchronize(aProductModelPropertyRelates, queryBean);
    }

    public void synchronize(
        ProductModelPropertyRelate[] aProductModelPropertyRelates,
        ProductModelPropertyRelateDAOQueryBean queryBean,
        net.dao.IDataAccessInterface.ISynchronizeCallback<ProductModelPropertyRelate> callBack)
        throws Exception {
        daoHelper.synchronize(aProductModelPropertyRelates, queryBean, callBack);
    }

    public static class JdbcProductModelPropertyRelateRowMapper
        implements RowMapper<ProductModelPropertyRelate> {
        public ProductModelPropertyRelate mapRow(ResultSet resultSet, int arg1)
            throws SQLException {
            ProductModelPropertyRelate object = new ProductModelPropertyRelate();

            int columnIndex = 1;

            int __dataType;

            try {
                Object id = null;

                id = resultSet.getObject(columnIndex++);

                object.setIdNull(resultSet.getBoolean(columnIndex++));

                if (id != null) {
                    setBeanValue(object, _DataObjectProperty.Id, id);
                }

                Object relateCode = null;

                relateCode = resultSet.getObject(columnIndex++);

                object.setRelateCodeNull(resultSet.getBoolean(columnIndex++));

                if (relateCode != null) {
                    setBeanValue(object, _DataObjectProperty.RelateCode,
                        relateCode);
                }

                Object relateName = null;

                relateName = resultSet.getObject(columnIndex++);

                object.setRelateNameNull(resultSet.getBoolean(columnIndex++));

                if (relateName != null) {
                    setBeanValue(object, _DataObjectProperty.RelateName,
                        relateName);
                }

                Object propertyId = null;

                propertyId = resultSet.getObject(columnIndex++);

                object.setPropertyIdNull(resultSet.getBoolean(columnIndex++));

                if (propertyId != null) {
                    setBeanValue(object, _DataObjectProperty.PropertyId,
                        propertyId);
                }

                Object relatedPropertyId = null;

                relatedPropertyId = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyIdNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyId != null) {
                    setBeanValue(object, _DataObjectProperty.RelatedPropertyId,
                        relatedPropertyId);
                }

                Object relatedType = null;

                relatedType = resultSet.getObject(columnIndex++);

                object.setRelatedTypeNull(resultSet.getBoolean(columnIndex++));

                if (relatedType != null) {
                    setBeanValue(object, _DataObjectProperty.RelatedType,
                        relatedType);
                }

                Object relatedConfig = null;

                relatedConfig = resultSet.getObject(columnIndex++);

                object.setRelatedConfigNull(resultSet.getBoolean(columnIndex++));

                if (relatedConfig != null) {
                    setBeanValue(object, _DataObjectProperty.RelatedConfig,
                        relatedConfig);
                }

                Object sortIndex = null;

                sortIndex = resultSet.getObject(columnIndex++);

                object.setSortIndexNull(resultSet.getBoolean(columnIndex++));

                if (sortIndex != null) {
                    setBeanValue(object, _DataObjectProperty.SortIndex,
                        sortIndex);
                }

                Object status = null;

                status = resultSet.getObject(columnIndex++);

                object.setStatusNull(resultSet.getBoolean(columnIndex++));

                if (status != null) {
                    setBeanValue(object, _DataObjectProperty.Status, status);
                }

                Object remarks = null;

                remarks = resultSet.getObject(columnIndex++);

                object.setRemarksNull(resultSet.getBoolean(columnIndex++));

                if (remarks != null) {
                    setBeanValue(object, _DataObjectProperty.Remarks, remarks);
                }

                Object objectRelatedId = null;

                objectRelatedId = resultSet.getObject(columnIndex++);

                object.setObjectRelatedIdNull(resultSet.getBoolean(
                        columnIndex++));

                if (objectRelatedId != null) {
                    setBeanValue(object, _DataObjectProperty.ObjectRelatedId,
                        objectRelatedId);
                }

                Object relatedPropertyName = null;

                relatedPropertyName = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyNameNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyName != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyName,
                        relatedPropertyName);
                }

                Object relatedPropertyDataType = null;

                relatedPropertyDataType = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyDataTypeNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyDataType != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyDataType,
                        relatedPropertyDataType);
                }

                Object relatedPropertyDataTypeId = null;

                relatedPropertyDataTypeId = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyDataTypeIdNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyDataTypeId != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyDataTypeId,
                        relatedPropertyDataTypeId);
                }

                Object relatedPropertyDataLength = null;

                relatedPropertyDataLength = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyDataLengthNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyDataLength != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyDataLength,
                        relatedPropertyDataLength);
                }

                Object relatedPropertyDataAccuracy = null;

                relatedPropertyDataAccuracy = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyDataAccuracyNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyDataAccuracy != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyDataAccuracy,
                        relatedPropertyDataAccuracy);
                }

                Object relatedPropertyIsAllowNull = null;

                relatedPropertyIsAllowNull = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyIsAllowNullNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyIsAllowNull != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyIsAllowNull,
                        relatedPropertyIsAllowNull);
                }

                Object relatedPropertyisPrimaryKey = null;

                relatedPropertyisPrimaryKey = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyisPrimaryKeyNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyisPrimaryKey != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyisPrimaryKey,
                        relatedPropertyisPrimaryKey);
                }

                Object relatedPropertyIsAutoInc = null;

                relatedPropertyIsAutoInc = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyIsAutoIncNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyIsAutoInc != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyIsAutoInc,
                        relatedPropertyIsAutoInc);
                }

                Object relatedPropertyObjectId = null;

                relatedPropertyObjectId = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyObjectIdNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyObjectId != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyObjectId,
                        relatedPropertyObjectId);
                }

                Object relatedPropertyObjectName = null;

                relatedPropertyObjectName = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyObjectNameNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyObjectName != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyObjectName,
                        relatedPropertyObjectName);
                }

                Object relatedPropertyObjectType = null;

                relatedPropertyObjectType = resultSet.getObject(columnIndex++);

                object.setRelatedPropertyObjectTypeNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedPropertyObjectType != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedPropertyObjectType,
                        relatedPropertyObjectType);
                }

                Object propertyName = null;

                propertyName = resultSet.getObject(columnIndex++);

                object.setPropertyNameNull(resultSet.getBoolean(columnIndex++));

                if (propertyName != null) {
                    setBeanValue(object, _DataObjectProperty.PropertyName,
                        propertyName);
                }

                Object propertyObjectId = null;

                propertyObjectId = resultSet.getObject(columnIndex++);

                object.setPropertyObjectIdNull(resultSet.getBoolean(
                        columnIndex++));

                if (propertyObjectId != null) {
                    setBeanValue(object, _DataObjectProperty.PropertyObjectId,
                        propertyObjectId);
                }

                Object propertyDataType = null;

                propertyDataType = resultSet.getObject(columnIndex++);

                object.setPropertyDataTypeNull(resultSet.getBoolean(
                        columnIndex++));

                if (propertyDataType != null) {
                    setBeanValue(object, _DataObjectProperty.PropertyDataType,
                        propertyDataType);
                }

                Object propertyObjectName = null;

                propertyObjectName = resultSet.getObject(columnIndex++);

                object.setPropertyObjectNameNull(resultSet.getBoolean(
                        columnIndex++));

                if (propertyObjectName != null) {
                    setBeanValue(object,
                        _DataObjectProperty.PropertyObjectName,
                        propertyObjectName);
                }

                Object propertyObjectType = null;

                propertyObjectType = resultSet.getObject(columnIndex++);

                object.setPropertyObjectTypeNull(resultSet.getBoolean(
                        columnIndex++));

                if (propertyObjectType != null) {
                    setBeanValue(object,
                        _DataObjectProperty.PropertyObjectType,
                        propertyObjectType);
                }

                return object;
            } catch (Exception e) {
                throw new SQLException(e.getMessage());
            }
        }
    }
}
